﻿@using Newtonsoft.Json
@model Qask.Web.Models.RegisterViewModel
@{
    ViewBag.Title = "Register";
}

<h2>@ViewBag.Title.</h2>

@Scripts.Render("~/bundles/RegisterAccountJsBundle")

<div ng-controller="RegisterAccountController" ng-init="init(@JsonConvert.SerializeObject(ViewBag.Timezones))">
    @using (Html.BeginForm("Register", "Account", FormMethod.Post, new { @class = "form-horizontal", role = "form" }))
    {
        @Html.AntiForgeryToken()
        <h4>Create a new account.</h4>
        <hr />
        @Html.ValidationSummary("", new { @class = "text-danger" })
    <!-- Added First Name field -->
        <div class="form-group">
            @Html.LabelFor(m => m.FirstName, new { @class = "col-md-2 control-label" })
            <div class="col-md-10">
                @Html.TextBoxFor(m => m.FirstName, new { @class = "form-control" })
            </div>
        </div>
    <!-- Added Last Name field -->
        <div class="form-group">
            @Html.LabelFor(m => m.LastName, new { @class = "col-md-2 control-label" })
            <div class="col-md-10">
                @Html.TextBoxFor(m => m.LastName, new { @class = "form-control" })
            </div>
        </div>
    <!-- Added TimeZone Dropdown -->
        <div class="form-group">
            <label class="col-md-2 control-label" for="Timezone">Timezone</label>
            <div class="col-md-10">
                <input id="Timezone" type="hidden" />
                @Html.HiddenFor(m => m.TimeZoneId)
            </div>
        </div>
        <div class="form-group">
            @Html.LabelFor(m => m.Email, new { @class = "col-md-2 control-label" })
            <div class="col-md-10">
                @Html.TextBoxFor(m => m.Email, new { @class = "form-control" })
            </div>
        </div>
        <div class="form-group">
            @Html.LabelFor(m => m.Password, new { @class = "col-md-2 control-label" })
            <div class="col-md-10">
                @Html.PasswordFor(m => m.Password, new { @class = "form-control" })
            </div>
        </div>
        <div class="form-group">
            @Html.LabelFor(m => m.ConfirmPassword, new { @class = "col-md-2 control-label" })
            <div class="col-md-10">
                @Html.PasswordFor(m => m.ConfirmPassword, new { @class = "form-control" })
            </div>
        </div>
        <div class="form-group">
            <div class="col-md-offset-2 col-md-10">
                <input type="submit" class="btn btn-primary" value="Register" />
            </div>
        </div>
    }
</div>